import { ref, type Ref } from 'vue'

const useToggle = (init = false): [Ref<boolean>, () => void] => {
  const toggle = ref(init)

  const setToggle = () => {
    toggle.value = !toggle.value
  }
  return [toggle, setToggle]
}

export default useToggle
